
import 'package:flustars/flustars.dart';
import 'package:json_annotation/json_annotation.dart';

part 'leads_call_log.g.dart';

@JsonSerializable()
class LeadsCallLog {
  ///id
  int? id;
  ///线索ID
  int? clueId;
  ///操作时间
  @JsonKey(fromJson: fullDateFromJson)
  String? operatorTime;
  ///操作人
  String? operatorPersonName;
  ///通话时长
  String? talkTimeShow;

  LeadsCallLog({this.id, this.clueId, this.operatorTime, this.operatorPersonName, this.talkTimeShow});

  factory LeadsCallLog.fromJson(Map<String, dynamic> json) => _$LeadsCallLogFromJson(json);

  Map<String,dynamic> toJson() => _$LeadsCallLogToJson(this);

}

String? fullDateFromJson(String? dateTime) {
  return (dateTime == null || dateTime == "") ? ""  : DateUtil.formatDate(DateTime.parse(dateTime), format: DateFormats.full);
}